#ifndef SESSIONHANDLER_H
#define SESSIONHANDLER_H

#include "JQHttpServer.h"
#include <QThread>
#include <QTcpSocket>

class SessionHandler
{
public:
    static void initDb();
    static void initHandler();
    static void setMainThread(QThread* thread);
    static void handle(QPointer<JQHttpServer::Session> session);
    static void initLocalSocket();

protected:
    void setSession(QPointer< JQHttpServer::Session > &session);

    virtual void handleSession()=0;

protected:
    QPointer< JQHttpServer::Session > m_session;
    static QThread* s_mainThread;
    static QMap<QString, QString> s_mapPhoneRandom;

    static QList<QMap<QString,QString>> s_listRequstUnlock;

private:
    static QMap<QString, SessionHandler*> m_mapUrlHandler;
};

#endif // SESSIONHANDLER_H
